<%@ tag language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!-- Attributes -->
<%@ attribute name="account" description="conta do usuario logado" required="false" rtexprvalue="true" type="enterprise.web.tookit.account.Account" %>
<%@ attribute name="isLogged" description="informar TRUE caso usuario ja estiver logado" required="true" rtexprvalue="true" type="java.lang.Boolean" %>

<div id="informacoesDivID">

	<c:choose>
		<c:when test="${true eq isLogged}">
			<div id="infoUserLogged">
				<table>
					<tbody>
						<tr>
							<!-- system informations -->
							<th><p>
								<fmt:message key="label.system.version"/>
							</p></th>
							
							<!-- Espaco em branco -->
							<th id="spaceInfo"><p/></th>
							
							<!-- column information user logged -->
							<th><p>
								<fmt:message key="label.bemvindo"/><c:out value="${account.firstname}"/>
							</p></th>
							
							<!-- se usuario logado, exibir link logout -->
							<th><a id="linkLogout">
								<fmt:message key="label.sair"/>
							</a></th>				
						</tr>	
					</tbody>
				</table>				
			</div>
		</c:when>
		
		<c:otherwise>
			<div id="infoUserNotLogged">
				<table>
					<tbody>
						<tr>
							<!-- system informations -->
							<th><p>
								<fmt:message key="label.system.version"/>
							</p></th>
							
							<!-- Espaco em branco -->
							<th id="spaceInfoNotLogged"><p/></th>
							
							<!-- column information user logged -->
							<th>
								<button type="button" id="btnCriarConta" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" >
									<fmt:message key="label.titulo.criar.usuario"/>
								</button> 
							</th>
						</tr>	
					</tbody>
				</table>	
			</div>
			
			<!-- DIV para modal de criacao de conta, inicialmente esta div esta invisivel -->
			<!-- para deixar visivel esta div, necessario alterar a propriedade display para 'block' ou pela propriedade 'autoOpen' do jQuery -->
			<div id="divCreateUserID" style="display: none;" title="<fmt:message key="label.titulo.criar.usuario"/>">
				
				<!-- Nome -->
		        <label for="username"><fmt:message key="label.username"/></label>
		        <input type="text" name="username" id="username" class="text ui-widget-content ui-corner-all"/>
		        
		        <!-- Sobrenome -->
		        <label for="lastName"><fmt:message key="label.lastName"/></label>
		        <input type="text" name="lastName" id="lastName" class="text ui-widget-content ui-corner-all"/>
		        
		        <!-- Email -->
		        <label for="email"><fmt:message key="label.email"/></label>
		        <!-- imagem para apresentar ok ou nok na validacao de existencia de username -->
		        <img id="imgCheckSucessUsername" style="visibility:hidden ;" alt="<fmt:message key="label.message.username.valido"/>" src="<c:url value="/images/Check-Icone.png"/>">
				<img id="imgCheckNoSucessUsername" style="visibility:hidden;" alt="<fmt:message key="label.message.username.nao.valido"/>" src="<c:url value="/images/cancel.png"/>">
		        <input type="text" name="email" id="email" class="text ui-widget-content ui-corner-all"/>
		        
		        <label for="password"><fmt:message key="label.password"/></label>
		        <input type="password" name="password" id="password" value="" class="text ui-widget-content ui-corner-all" />
		        
		        <label for="confirPassword"><fmt:message key="label.confirPassword"/></label>
		        <input type="password" name="confirPassword" id="confirPassword" value="" class="text ui-widget-content ui-corner-all" />
		        
		        <!-- DIV inicialmente invisivel que servira para ser exibida mensagem de validacao-->
				<div id="divValidationUserID" style="display: none; color: red; border: 3px;" title="<fmt:message key="mensagem.validacao.campo"/>">
					<p>
						<span id="msgValidationUserID"><fmt:message key="mensagem.validacao.campo.obrigatorio"/></span>
					</p>
				</div>
			</div>
			
			<!-- DIV inicialmente invisivel que servira para ser exibida mensagem -->
			<div id="divMessageUserID" style="display: none;" title="<fmt:message key="label.message"/>">
				<p>
					<span id="msgUserID"></span>
				</p>
			</div>
		</c:otherwise>
	</c:choose>
</div>
